package com.sg.service.biz.pbff.impl;

import cn.hutool.core.bean.BeanUtil;
import com.sg.common.exception.Assert;
import com.sg.common.util.RedisUtil;
import com.sg.dto.biz.pbff.req.*;
import com.sg.dto.biz.pbff.res.*;
import com.sg.dto.integration.component.ImplementIniReportTaskMsgLocationByLoginComReqDto;
import com.sg.dto.integration.component.ImplementIniReportTaskMsgLocationByLoginComRespDto;
import com.sg.service.biz.pbff.MemberService;
import com.sg.service.biz.pbff.nb.NbMember;
import com.wicket.okrframework.integration.dto.*;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.stream.Collectors;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Service
public class MemberServiceImpl implements MemberService {

    @Resource
    com.sg.service.biz.framework.MemberService fwBaseMemberClient;
    @Resource
    com.sg.service.biz.framework.OrgDictionaryService fwBaseOrgDictionaryClient;
    @Resource
    com.sg.service.biz.framework.InductionRecordService fwBaseInductionRecordClient;
    @Resource
    private RedisUtil redisUtil;
    @Resource
    com.sg.service.biz.framework.InterfaceModeService fwBaseInterfaceModeClient;
    @Resource
    NbMember nbMember;
    @Resource
    com.sg.service.biz.component.MessageService fwCompMessageClient;

    /**
     * B1-2查询员工身份人员列表（平台）[448]
     * gen by moon at 8/10/2022, 3:40:01 AM
     */
    @Trace(operationName = "B1-2查询员工身份人员列表（平台）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffQueryStaffBeginMemberListRespDto queryStaffBeginMemberList(BffQueryStaffBeginMemberListReqDto reqDto) {


        QueryStaffBeginMemberListRespDto queryStaffBeginMemberListRespDto_1 = null;
//步骤0: D1-2查询员工身份人员列表 - queryStaffBeginMemberList
        QueryStaffBeginMemberListRespDto queryStaffBeginMemberListRespDto = null;
        QueryStaffBeginMemberListReqDto queryStaffBeginMemberListReqDto = new QueryStaffBeginMemberListReqDto();
        if (reqDto != null) {
            queryStaffBeginMemberListReqDto.setIdCardName(reqDto.getIdCardName());//sourceId:29248_1
            queryStaffBeginMemberListReqDto.setIsInvalid(reqDto.getIsInvalid());//sourceId:29247_1
            queryStaffBeginMemberListReqDto.setSource(reqDto.getSource());//sourceId:29249_1
            queryStaffBeginMemberListReqDto.setSpaceId(reqDto.getSpaceId());//sourceId:29250_1
        }

        /*D1-2查询员工身份人员列表[1253]   */
        Assert.isNull(queryStaffBeginMemberListReqDto.getIsInvalid(), "B1-2查询员工身份人员列表（平台）-D1-2查询员工身份人员列表-是否失效不能为空", false);
        Assert.isNull(queryStaffBeginMemberListReqDto.getSpaceId(), "B1-2查询员工身份人员列表（平台）-D1-2查询员工身份人员列表-创建于空间ID不能为空", false);
        queryStaffBeginMemberListRespDto = fwBaseMemberClient.queryStaffBeginMemberList(queryStaffBeginMemberListReqDto).getData();

        queryStaffBeginMemberListRespDto_1 = queryStaffBeginMemberListRespDto;

        BffQueryStaffBeginMemberListRespDto retData = new BffQueryStaffBeginMemberListRespDto();
        if (queryStaffBeginMemberListRespDto_1 != null) {
            retData.setBeginMemberList(queryStaffBeginMemberListRespDto_1.getBeginMemberList().stream().map(item -> BeanUtil.toBean(item, BffBeginMemberDto.class)).collect(Collectors.toList()));//sourceId:63328_1
        }


        return retData;
    }

    /**
     * B1-2查询角色人员详情（平台）[1006]
     * gen by moon at 10/24/2022, 4:54:22 AM
     */
    @Trace(operationName = "B1-2查询角色人员详情（平台）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffQueryRoleRelDetailRespDto queryRoleRelDetail(BffQueryRoleRelDetailReqDto reqDto) {


        QueryRoleRelDetailRespDto queryRoleRelDetailRespDto_1 = null;
        QueryOrgClassBorderDetailComBorderRespDto queryOrgClassBorderDetailComBorderRespDto_1 = null;
        QueryOrgClassBorderDetailComBorderRespDto queryOrgClassBorderDetailComBorderRespDto_3 = null;
        QueryInductionRecordInfoDetailComRespDto queryInductionRecordInfoDetailComRespDto_1 = null;
//步骤0: D1-1执行清除底层框架服务公共字段内存(公共) - implementBottomPublicFieldClearMemoryCom
        //ModelCode: clearFieldCache
        ImplementBottomPublicFieldClearMemoryComRespDto clearFieldCacheRes = null;
        ImplementBottomPublicFieldClearMemoryComReqDto clearFieldCacheReq = new ImplementBottomPublicFieldClearMemoryComReqDto();


        /*D1-1执行清除底层框架服务公共字段内存(公共)[4994]  用于平台查询数据时，清除当前特定字段的公共缓存 */

        clearFieldCacheRes = nbMember.implementBottomPublicFieldClearMemoryCom(clearFieldCacheReq);


//步骤1: D1-2查询角色人员详情 - queryRoleRelDetail
        QueryRoleRelDetailRespDto queryRoleRelDetailRespDto = null;
        QueryRoleRelDetailReqDto queryRoleRelDetailReqDto = new QueryRoleRelDetailReqDto();
        if (reqDto != null) {
            queryRoleRelDetailReqDto.setRoleMemberId(reqDto.getRoleMemberId());//SimpleFieldAssign//sourceId:29640_1
            queryRoleRelDetailReqDto.setOriginalRoleMemberId(reqDto.getOriginalRoleMemberId());//SimpleFieldAssign//sourceId:29665_1
            queryRoleRelDetailReqDto.setUserId(reqDto.getUserId());//SimpleFieldAssign//sourceId:29663_1
            queryRoleRelDetailReqDto.setRoleId(reqDto.getRoleId());//SimpleFieldAssign//sourceId:29664_1
        }

        /*D1-2查询角色人员详情[1171]   */
        Assert.isNull(queryRoleRelDetailReqDto.getRoleMemberId(), "B1-2查询角色人员详情（平台）-D1-2查询角色人员详情-角色人员ID不能为空", false);
        Assert.isNull(queryRoleRelDetailReqDto.getOriginalRoleMemberId(), "B1-2查询角色人员详情（平台）-D1-2查询角色人员详情-身份人员ID不能为空", false);
        Assert.isNull(queryRoleRelDetailReqDto.getUserId(), "B1-2查询角色人员详情（平台）-D1-2查询角色人员详情-个人账号不能为空", false);
        Assert.isNull(queryRoleRelDetailReqDto.getRoleId(), "B1-2查询角色人员详情（平台）-D1-2查询角色人员详情-角色ID不能为空", false);
        queryRoleRelDetailRespDto = fwBaseMemberClient.queryRoleRelDetail(queryRoleRelDetailReqDto).getData();


        queryRoleRelDetailRespDto_1 = queryRoleRelDetailRespDto;

//步骤2: D1-3查询组织架构字典边界详情(公共)(边界) - queryOrgClassBorderDetailComBorder
        QueryOrgClassBorderDetailComBorderRespDto queryOrgClassBorderDetailComBorderRespDto = null;
        if (queryRoleRelDetailRespDto != null && queryRoleRelDetailRespDto != null && queryRoleRelDetailRespDto.getInductionTypeDictionaryId() != null) {
            QueryOrgClassBorderDetailComBorderReqDto queryOrgClassBorderDetailComBorderReqDto = new QueryOrgClassBorderDetailComBorderReqDto();
            queryOrgClassBorderDetailComBorderReqDto.setPurposeCode("INDUCTION_TYPE");//sourceId:43788_1
            if (queryRoleRelDetailRespDto != null) {
                queryOrgClassBorderDetailComBorderReqDto.setTypeDictionaryId(queryRoleRelDetailRespDto.getInductionTypeDictionaryId());//SimpleFieldAssign//sourceId:43789_1
            }

            /*D1-3查组织架构类型字典边界（就职类型数据字典）[953]   */
            Assert.isNull(queryOrgClassBorderDetailComBorderReqDto.getPurposeCode(), "B1-2查询角色人员详情（平台）-D1-3查组织架构类型字典边界（就职类型数据字典）-类型用途编码不能为空", false);
            queryOrgClassBorderDetailComBorderRespDto = fwBaseOrgDictionaryClient.queryOrgClassBorderDetailComBorder(queryOrgClassBorderDetailComBorderReqDto).getData();


            queryOrgClassBorderDetailComBorderRespDto_1 = queryOrgClassBorderDetailComBorderRespDto;
        }

//步骤3: D1-3查询组织架构字典边界详情(公共)(边界) - queryOrgClassBorderDetailComBorder
        QueryOrgClassBorderDetailComBorderRespDto queryOrgClassBorderDetailComBorderRespDto_2 = null;
        if (queryRoleRelDetailRespDto != null && queryRoleRelDetailRespDto != null && queryRoleRelDetailRespDto.getInductionStateDictionaryId() != null) {
            QueryOrgClassBorderDetailComBorderReqDto queryOrgClassBorderDetailComBorderReqDto_1 = new QueryOrgClassBorderDetailComBorderReqDto();
            queryOrgClassBorderDetailComBorderReqDto_1.setPurposeCode("INDUCTION_STATE");//sourceId:43800_1
            if (queryRoleRelDetailRespDto != null) {
                queryOrgClassBorderDetailComBorderReqDto_1.setTypeDictionaryId(queryRoleRelDetailRespDto.getInductionStateDictionaryId());//SimpleFieldAssign//sourceId:43801_1
            }

            /*D1-3查组织架构类型字典边界（就职状态数据字典）[953]   */
            Assert.isNull(queryOrgClassBorderDetailComBorderReqDto_1.getPurposeCode(), "B1-2查询角色人员详情（平台）-D1-3查组织架构类型字典边界（就职状态数据字典）-类型用途编码不能为空", false);
            queryOrgClassBorderDetailComBorderRespDto_2 = fwBaseOrgDictionaryClient.queryOrgClassBorderDetailComBorder(queryOrgClassBorderDetailComBorderReqDto_1).getData();


            queryOrgClassBorderDetailComBorderRespDto_3 = queryOrgClassBorderDetailComBorderRespDto_2;
        }

//步骤4: D1-3查询个人就职记录信息详情（公共） - queryInductionRecordInfoDetailCom
        QueryInductionRecordInfoDetailComRespDto queryInductionRecordInfoDetailComRespDto = null;
        if (queryRoleRelDetailRespDto != null) {
            QueryInductionRecordInfoDetailComReqDto queryInductionRecordInfoDetailComReqDto = new QueryInductionRecordInfoDetailComReqDto();
            if (queryRoleRelDetailRespDto != null) {
                queryInductionRecordInfoDetailComReqDto.setInductionRecordId(queryRoleRelDetailRespDto.getOperationInductionId());//SimpleFieldAssign//sourceId:25744_1
            }

            /*D1-3查询个人就职记录信息详情（公共）[715] 获取上步骤的入参就职记录ID，查询操作人的姓名、昵称。  */
            Assert.isNull(queryInductionRecordInfoDetailComReqDto.getInductionRecordId(), "B1-2查询角色人员详情（平台）-D1-3查询个人就职记录信息详情（公共）-就职记录ID不能为空", false);
            queryInductionRecordInfoDetailComRespDto = fwBaseInductionRecordClient.queryInductionRecordInfoDetailCom(queryInductionRecordInfoDetailComReqDto).getData();


            queryInductionRecordInfoDetailComRespDto_1 = queryInductionRecordInfoDetailComRespDto;
        }

        BffQueryRoleRelDetailRespDto retData = new BffQueryRoleRelDetailRespDto();
        if (queryRoleRelDetailRespDto_1 != null) {
            retData.setRoleMemberId(queryRoleRelDetailRespDto_1.getRoleMemberId());//SimpleFieldAssign//sourceId:29919_1
            retData.setOriginalRoleMemberId(queryRoleRelDetailRespDto_1.getOriginalRoleMemberId());//SimpleFieldAssign//sourceId:29920_1
            retData.setSubjectLifeCycle(queryRoleRelDetailRespDto_1.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:29700_1
            retData.setRelationshipValid(queryRoleRelDetailRespDto_1.getRelationshipValid());//SimpleFieldAssign//sourceId:29701_1
            retData.setStatus(queryRoleRelDetailRespDto_1.getStatus());//SimpleFieldAssign//sourceId:29702_1
            retData.setInvalidReason(queryRoleRelDetailRespDto_1.getInvalidReason());//SimpleFieldAssign//sourceId:29703_1
            retData.setInvalidTime(queryRoleRelDetailRespDto_1.getInvalidTime());//SimpleFieldAssign//sourceId:29704_1
            retData.setIsArchive(queryRoleRelDetailRespDto_1.getIsArchive());//SimpleFieldAssign//sourceId:29705_1
            retData.setOperationInductionId(queryRoleRelDetailRespDto_1.getOperationInductionId());//SimpleFieldAssign//sourceId:29706_1
            retData.setOperateTime(queryRoleRelDetailRespDto_1.getOperateTime());//SimpleFieldAssign//sourceId:29707_1
            retData.setUserName(queryRoleRelDetailRespDto_1.getUserName());//SimpleFieldAssign//sourceId:29710_1
            retData.setEmail(queryRoleRelDetailRespDto_1.getEmail());//SimpleFieldAssign//sourceId:29711_1
            retData.setPhone(queryRoleRelDetailRespDto_1.getPhone());//SimpleFieldAssign//sourceId:29712_1
            retData.setIdCardName(queryRoleRelDetailRespDto_1.getIdCardName());//SimpleFieldAssign//sourceId:29714_1
            retData.setNickName(queryRoleRelDetailRespDto_1.getNickName());//SimpleFieldAssign//sourceId:29715_1
            retData.setUserFace(queryRoleRelDetailRespDto_1.getUserFace());//SimpleFieldAssign//sourceId:29716_1
            retData.setUserIntro(queryRoleRelDetailRespDto_1.getUserIntro());//SimpleFieldAssign//sourceId:29717_1
            retData.setSex(queryRoleRelDetailRespDto_1.getSex());//SimpleFieldAssign//sourceId:29718_1
            retData.setBirthday(queryRoleRelDetailRespDto_1.getBirthday());//SimpleFieldAssign//sourceId:29719_1
            retData.setCity(queryRoleRelDetailRespDto_1.getCity());//SimpleFieldAssign//sourceId:29720_1
            retData.setRoleMemberCode(queryRoleRelDetailRespDto_1.getRoleMemberCode());//SimpleFieldAssign//sourceId:29721_1
            retData.setPositionIdName(queryRoleRelDetailRespDto_1.getPositionIdName());//SimpleFieldAssign//sourceId:29722_1
            retData.setRoleName(queryRoleRelDetailRespDto_1.getRoleName());//SimpleFieldAssign//sourceId:29723_1
            retData.setIsPtJob(queryRoleRelDetailRespDto_1.getIsPtJob());//SimpleFieldAssign//sourceId:45915_1
        }
        if (queryInductionRecordInfoDetailComRespDto_1 != null) {
            retData.setOperaterIdCardName(queryInductionRecordInfoDetailComRespDto_1.getIdCardName());//SimpleFieldAssign//sourceId:29725_1
            retData.setOperaterNickName(queryInductionRecordInfoDetailComRespDto_1.getNickName());//SimpleFieldAssign//sourceId:29726_1
        }
        if (queryOrgClassBorderDetailComBorderRespDto_1 != null) {
            retData.setInductionTypeDictionaryName(queryOrgClassBorderDetailComBorderRespDto_1.getTypeDictionaryName());//SimpleFieldAssign//sourceId:43805_1
        }
        if (queryOrgClassBorderDetailComBorderRespDto_3 != null) {
            retData.setInductionStateDictionaryName(queryOrgClassBorderDetailComBorderRespDto_3.getTypeDictionaryName());//SimpleFieldAssign//sourceId:43806_1
        }


        return retData;
    }

    /**
     * B1-新增空间管理员角色人员（平台）[971]
     * gen by moon at 1/24/2024, 4:12:15 AM
     */
    @Trace(operationName = "B1-新增空间管理员角色人员（平台）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffAddAdminRoleRelRespDto addAdminRoleRel(BffAddAdminRoleRelReqDto reqDto) {


        AddAdminRoleRelRespDto addAdminRoleRelRespDto_1 = null;
//步骤0: D1-新增空间管理员角色人员（平台） - addAdminRoleRel
        AddAdminRoleRelRespDto addAdminRoleRelRespDto = null;
        AddAdminRoleRelReqDto addAdminRoleRelReqDto = new AddAdminRoleRelReqDto();
        addAdminRoleRelReqDto.setIsPasswordExit("TRUE");//sourceId:43851_1
        addAdminRoleRelReqDto.setIsUserInfoDone("FALSE");//sourceId:45521_1
        if (reqDto != null) {
            addAdminRoleRelReqDto.setPhone(reqDto.getPhone());//SimpleFieldAssign//sourceId:20623_1
            addAdminRoleRelReqDto.setUserName(reqDto.getUserName());//SimpleFieldAssign//sourceId:43850_1
            addAdminRoleRelReqDto.setPassword(reqDto.getPassword());//SimpleFieldAssign//sourceId:43910_1
            addAdminRoleRelReqDto.setVerificationCode(reqDto.getVerificationCode());//SimpleFieldAssign//sourceId:43855_1
            addAdminRoleRelReqDto.setIdCardName(reqDto.getIdCardName());//SimpleFieldAssign//sourceId:20626_1
            addAdminRoleRelReqDto.setUserFace(reqDto.getUserFace());//SimpleFieldAssign//sourceId:20627_1
            addAdminRoleRelReqDto.setRoleMemberCode(reqDto.getRoleMemberCode());//SimpleFieldAssign//sourceId:23763_1
            addAdminRoleRelReqDto.setPassByPhone(reqDto.getPassByPhone());//SimpleFieldAssign//sourceId:23762_1
            addAdminRoleRelReqDto.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:20624_1
            addAdminRoleRelReqDto.setAppId(reqDto.getAppId());//SimpleFieldAssign//sourceId:20625_1
            addAdminRoleRelReqDto.setSenceId(reqDto.getSenceId());//SimpleFieldAssign//sourceId:43854_1
        }

        /*D1-新增空间管理员角色人员（平台）[972]   */
        Assert.isNull(addAdminRoleRelReqDto.getPhone(), "B1-新增空间管理员角色人员（平台）-D1-新增空间管理员角色人员（平台）-绑定手机不能为空", false);
        Assert.isNull(addAdminRoleRelReqDto.getPassword(), "B1-新增空间管理员角色人员（平台）-D1-新增空间管理员角色人员（平台）-密码不能为空", false);
        Assert.isNull(addAdminRoleRelReqDto.getIdCardName(), "B1-新增空间管理员角色人员（平台）-D1-新增空间管理员角色人员（平台）-真实姓名不能为空", false);
        Assert.isNull(addAdminRoleRelReqDto.getUserFace(), "B1-新增空间管理员角色人员（平台）-D1-新增空间管理员角色人员（平台）-真实头像不能为空", false);
        Assert.isNull(addAdminRoleRelReqDto.getRoleMemberCode(), "B1-新增空间管理员角色人员（平台）-D1-新增空间管理员角色人员（平台）-身份人员编号不能为空", false);
        Assert.isNull(addAdminRoleRelReqDto.getPassByPhone(), "B1-新增空间管理员角色人员（平台）-D1-新增空间管理员角色人员（平台）-手机激活状态不能为空", false);
        Assert.isNull(addAdminRoleRelReqDto.getSpaceId(), "B1-新增空间管理员角色人员（平台）-D1-新增空间管理员角色人员（平台）-创建于空间ID不能为空", false);
        Assert.isNull(addAdminRoleRelReqDto.getAppId(), "B1-新增空间管理员角色人员（平台）-D1-新增空间管理员角色人员（平台）-创建于联盟应用ID不能为空", false);
        Assert.isNull(addAdminRoleRelReqDto.getIsPasswordExit(), "B1-新增空间管理员角色人员（平台）-D1-新增空间管理员角色人员（平台）-密码是否为空不能为空", false);
        Assert.isNull(addAdminRoleRelReqDto.getSenceId(), "B1-新增空间管理员角色人员（平台）-D1-新增空间管理员角色人员（平台）-归属于场景ID不能为空", false);
        Assert.isNull(addAdminRoleRelReqDto.getIsUserInfoDone(), "B1-新增空间管理员角色人员（平台）-D1-新增空间管理员角色人员（平台）-个人资料是否完善不能为空", false);
        addAdminRoleRelRespDto = fwBaseMemberClient.addAdminRoleRel(addAdminRoleRelReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        addAdminRoleRelRespDto_1 = addAdminRoleRelRespDto;

//步骤1: D2-执行初始化身份人员固定位置消息数量(公共) - implementIniReportTaskMsgLocationByLoginCom
        ImplementIniReportTaskMsgLocationByLoginComRespDto implementIniReportTaskMsgLocationByLoginComRespDto = null;
        if (addAdminRoleRelRespDto != null) {
            ImplementIniReportTaskMsgLocationByLoginComReqDto implementIniReportTaskMsgLocationByLoginComReqDto = new ImplementIniReportTaskMsgLocationByLoginComReqDto();
            implementIniReportTaskMsgLocationByLoginComReqDto.setSurfaceCode("ORIGINAL_ROLE_MEMBER");//sourceId:1499660_1
            if (addAdminRoleRelRespDto != null) {
                implementIniReportTaskMsgLocationByLoginComReqDto.setEntityId(addAdminRoleRelRespDto.getOriginalRoleMemberId());//SimpleFieldAssign//sourceId:1499659_1
                implementIniReportTaskMsgLocationByLoginComReqDto.setOriginalRoleMemberId(addAdminRoleRelRespDto.getOriginalRoleMemberId());//SimpleFieldAssign//sourceId:1499657_1
                implementIniReportTaskMsgLocationByLoginComReqDto.setUserId(addAdminRoleRelRespDto.getUserId());//SimpleFieldAssign//sourceId:1499656_1
            }
            if (reqDto != null) {
                implementIniReportTaskMsgLocationByLoginComReqDto.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:1499658_1
            }

            /*D2-执行初始化身份人员固定位置消息数量(公共)[7893]   */
            Assert.isNull(implementIniReportTaskMsgLocationByLoginComReqDto.getSurfaceCode(), "B1-新增空间管理员角色人员（平台）-D2-执行初始化身份人员固定位置消息数量(公共)-归属内容类型编码不能为空", false);
            Assert.isNull(implementIniReportTaskMsgLocationByLoginComReqDto.getEntityId(), "B1-新增空间管理员角色人员（平台）-D2-执行初始化身份人员固定位置消息数量(公共)-归属内容ID不能为空", false);
            Assert.isNull(implementIniReportTaskMsgLocationByLoginComReqDto.getOriginalRoleMemberId(), "B1-新增空间管理员角色人员（平台）-D2-执行初始化身份人员固定位置消息数量(公共)-身份人员ID不能为空", false);
            Assert.isNull(implementIniReportTaskMsgLocationByLoginComReqDto.getUserId(), "B1-新增空间管理员角色人员（平台）-D2-执行初始化身份人员固定位置消息数量(公共)-账号不能为空", false);
            Assert.isNull(implementIniReportTaskMsgLocationByLoginComReqDto.getSpaceId(), "B1-新增空间管理员角色人员（平台）-D2-执行初始化身份人员固定位置消息数量(公共)-创建于空间ID不能为空", false);
            implementIniReportTaskMsgLocationByLoginComRespDto = fwCompMessageClient.implementIniReportTaskMsgLocationByLoginCom(implementIniReportTaskMsgLocationByLoginComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        }

        BffAddAdminRoleRelRespDto retData = new BffAddAdminRoleRelRespDto();
        if (addAdminRoleRelRespDto_1 != null) {
            retData.setRoleMemberId(addAdminRoleRelRespDto_1.getRoleMemberId());//SimpleFieldAssign//sourceId:28391_1
        }


        return retData;
    }

    /**
     * B1-2查询角色人员列表（平台）[453]
     * gen by moon at 8/15/2022, 10:27:37 PM
     */
    @Trace(operationName = "B1-2查询角色人员列表（平台）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffQueryRoleRelListRespDto queryRoleRelList(BffQueryRoleRelListReqDto reqDto) {


        QueryRoleRelListRespDto queryRoleRelListRespDto_1 = null;
//步骤0: D1-2查询角色人员列表 - queryRoleRelList
        QueryRoleRelListRespDto queryRoleRelListRespDto = null;
        QueryRoleRelListReqDto queryRoleRelListReqDto = new QueryRoleRelListReqDto();
        if (reqDto != null) {
            queryRoleRelListReqDto.setRoleCode(reqDto.getRoleCode());//sourceId:23474_1
            queryRoleRelListReqDto.setIsArchive(reqDto.getIsArchive());//sourceId:25290_1
            queryRoleRelListReqDto.setSpaceId(reqDto.getSpaceId());//sourceId:23478_1
        }

        /*D1-2查询角色人员列表[1134]   */
        Assert.isNull(queryRoleRelListReqDto.getRoleCode(), "B1-2查询角色人员列表（平台）-D1-2查询角色人员列表-角色标识不能为空", false);
        Assert.isNull(queryRoleRelListReqDto.getIsArchive(), "B1-2查询角色人员列表（平台）-D1-2查询角色人员列表-是否存档不能为空", false);
        Assert.isNull(queryRoleRelListReqDto.getSpaceId(), "B1-2查询角色人员列表（平台）-D1-2查询角色人员列表-创建于空间ID不能为空", false);
        queryRoleRelListRespDto = fwBaseMemberClient.queryRoleRelList(queryRoleRelListReqDto).getData();

        queryRoleRelListRespDto_1 = queryRoleRelListRespDto;

        BffQueryRoleRelListRespDto retData = new BffQueryRoleRelListRespDto();
        if (queryRoleRelListRespDto_1 != null) {
            retData.setRoleRelList(queryRoleRelListRespDto_1.getRoleRelList().stream().map(item -> BeanUtil.toBean(item, BffRoleRelDto.class)).collect(Collectors.toList()));//sourceId:23471_1
        }


        return retData;
    }

    /**
     * B1-2查询员工身份人员详情（平台）[450]
     * gen by moon at 5/21/2023, 7:14:57 AM
     */
    @Trace(operationName = "B1-2查询员工身份人员详情（平台）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffQueryStaffBeginMemberDetailRespDto queryStaffBeginMemberDetail(BffQueryStaffBeginMemberDetailReqDto reqDto) {


        QueryStaffBeginMemberDetailRespDto queryStaffBeginMemberDetailRespDto_1 = null;
        QueryOrgClassBorderDetailComBorderRespDto queryOrgClassBorderDetailComBorderRespDto_1 = null;
        QueryOrgClassBorderDetailComBorderRespDto queryOrgClassBorderDetailComBorderRespDto_3 = null;
        QueryInductionRecordInfoDetailComRespDto queryInductionRecordInfoDetailComRespDto_1 = null;
//步骤0: D1-2查询员工身份人员详情 - queryStaffBeginMemberDetail
        QueryStaffBeginMemberDetailRespDto queryStaffBeginMemberDetailRespDto = null;
        QueryStaffBeginMemberDetailReqDto queryStaffBeginMemberDetailReqDto = new QueryStaffBeginMemberDetailReqDto();
        if (reqDto != null) {
            queryStaffBeginMemberDetailReqDto.setOriginalRoleMemberId(reqDto.getOriginalRoleMemberId());//SimpleFieldAssign//sourceId:24412_1
        }

        /*D1-2查询员工身份人员详情[392]   */
        Assert.isNull(queryStaffBeginMemberDetailReqDto.getOriginalRoleMemberId(), "B1-2查询员工身份人员详情（平台）-D1-2查询员工身份人员详情-身份人员ID不能为空", false);
        queryStaffBeginMemberDetailRespDto = fwBaseMemberClient.queryStaffBeginMemberDetail(queryStaffBeginMemberDetailReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        queryStaffBeginMemberDetailRespDto_1 = queryStaffBeginMemberDetailRespDto;

//步骤1: D1-3查询组织架构字典边界详情(公共)(边界) - queryOrgClassBorderDetailComBorder
        QueryOrgClassBorderDetailComBorderRespDto queryOrgClassBorderDetailComBorderRespDto = null;
        if (queryStaffBeginMemberDetailRespDto != null && queryStaffBeginMemberDetailRespDto != null && queryStaffBeginMemberDetailRespDto.getInductionTypeDictionaryId() != null) {
            QueryOrgClassBorderDetailComBorderReqDto queryOrgClassBorderDetailComBorderReqDto = new QueryOrgClassBorderDetailComBorderReqDto();
            queryOrgClassBorderDetailComBorderReqDto.setPurposeCode("INDUCTION_TYPE");//sourceId:43284_1
            if (queryStaffBeginMemberDetailRespDto != null) {
                queryOrgClassBorderDetailComBorderReqDto.setTypeDictionaryId(queryStaffBeginMemberDetailRespDto.getInductionTypeDictionaryId());//SimpleFieldAssign//sourceId:43285_1
            }

            /*D1-3查组织架构类型字典边界（就职类型数据字典）[953]   */
            Assert.isNull(queryOrgClassBorderDetailComBorderReqDto.getPurposeCode(), "B1-2查询员工身份人员详情（平台）-D1-3查组织架构类型字典边界（就职类型数据字典）-类型用途编码不能为空", false);
            Assert.isNull(queryOrgClassBorderDetailComBorderReqDto.getTypeDictionaryId(), "B1-2查询员工身份人员详情（平台）-D1-3查组织架构类型字典边界（就职类型数据字典）-类型字典ID不能为空", false);
            queryOrgClassBorderDetailComBorderRespDto = fwBaseOrgDictionaryClient.queryOrgClassBorderDetailComBorder(queryOrgClassBorderDetailComBorderReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


            queryOrgClassBorderDetailComBorderRespDto_1 = queryOrgClassBorderDetailComBorderRespDto;
        }

//步骤2: D1-3查询组织架构字典边界详情(公共)(边界) - queryOrgClassBorderDetailComBorder
        QueryOrgClassBorderDetailComBorderRespDto queryOrgClassBorderDetailComBorderRespDto_2 = null;
        if (queryStaffBeginMemberDetailRespDto != null && queryStaffBeginMemberDetailRespDto != null && queryStaffBeginMemberDetailRespDto.getInductionStateDictionaryId() != null) {
            QueryOrgClassBorderDetailComBorderReqDto queryOrgClassBorderDetailComBorderReqDto_1 = new QueryOrgClassBorderDetailComBorderReqDto();
            queryOrgClassBorderDetailComBorderReqDto_1.setPurposeCode("INDUCTION_STATE");//sourceId:43304_1
            if (queryStaffBeginMemberDetailRespDto != null) {
                queryOrgClassBorderDetailComBorderReqDto_1.setTypeDictionaryId(queryStaffBeginMemberDetailRespDto.getInductionStateDictionaryId());//SimpleFieldAssign//sourceId:43305_1
            }

            /*D1-3查组织架构类型字典边界（就职状态数据字典）[953]   */
            Assert.isNull(queryOrgClassBorderDetailComBorderReqDto_1.getPurposeCode(), "B1-2查询员工身份人员详情（平台）-D1-3查组织架构类型字典边界（就职状态数据字典）-类型用途编码不能为空", false);
            Assert.isNull(queryOrgClassBorderDetailComBorderReqDto_1.getTypeDictionaryId(), "B1-2查询员工身份人员详情（平台）-D1-3查组织架构类型字典边界（就职状态数据字典）-类型字典ID不能为空", false);
            queryOrgClassBorderDetailComBorderRespDto_2 = fwBaseOrgDictionaryClient.queryOrgClassBorderDetailComBorder(queryOrgClassBorderDetailComBorderReqDto_1).getData()/*vcase invoke 跨dubbo调用;*/;


            queryOrgClassBorderDetailComBorderRespDto_3 = queryOrgClassBorderDetailComBorderRespDto_2;
        }

//步骤3: D1-3查询个人就职记录信息详情（公共） - queryInductionRecordInfoDetailCom
        QueryInductionRecordInfoDetailComRespDto queryInductionRecordInfoDetailComRespDto = null;
        if (queryStaffBeginMemberDetailRespDto != null) {
            QueryInductionRecordInfoDetailComReqDto queryInductionRecordInfoDetailComReqDto = new QueryInductionRecordInfoDetailComReqDto();
            if (queryStaffBeginMemberDetailRespDto != null) {
                queryInductionRecordInfoDetailComReqDto.setInductionRecordId(queryStaffBeginMemberDetailRespDto.getOperationInductionId());//SimpleFieldAssign//sourceId:24479_1
            }

            /*D1-3查询个人就职记录信息详情（公共）[715]   */
            Assert.isNull(queryInductionRecordInfoDetailComReqDto.getInductionRecordId(), "B1-2查询员工身份人员详情（平台）-D1-3查询个人就职记录信息详情（公共）-就职记录ID不能为空", false);
            queryInductionRecordInfoDetailComRespDto = fwBaseInductionRecordClient.queryInductionRecordInfoDetailCom(queryInductionRecordInfoDetailComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


            queryInductionRecordInfoDetailComRespDto_1 = queryInductionRecordInfoDetailComRespDto;
        }

        BffQueryStaffBeginMemberDetailRespDto retData = new BffQueryStaffBeginMemberDetailRespDto();
        if (queryStaffBeginMemberDetailRespDto_1 != null) {
            retData.setOriginalRoleMemberId(queryStaffBeginMemberDetailRespDto_1.getOriginalRoleMemberId());//SimpleFieldAssign//sourceId:30803_1
            retData.setRoleMemberCode(queryStaffBeginMemberDetailRespDto_1.getRoleMemberCode());//SimpleFieldAssign//sourceId:24489_1
            retData.setUserId(queryStaffBeginMemberDetailRespDto_1.getUserId());//SimpleFieldAssign//sourceId:963782_1
            retData.setPositionIdName(queryStaffBeginMemberDetailRespDto_1.getPositionIdName());//SimpleFieldAssign//sourceId:24490_1
            retData.setIsTransaction(queryStaffBeginMemberDetailRespDto_1.getIsTransaction());//SimpleFieldAssign//sourceId:50517_1
            retData.setIsInvalid(queryStaffBeginMemberDetailRespDto_1.getIsInvalid());//SimpleFieldAssign//sourceId:24491_1
            retData.setInvalidType(queryStaffBeginMemberDetailRespDto_1.getInvalidType());//SimpleFieldAssign//sourceId:24492_1
            retData.setInvalidReason(queryStaffBeginMemberDetailRespDto_1.getInvalidReason());//SimpleFieldAssign//sourceId:24493_1
            retData.setInvalidTime(queryStaffBeginMemberDetailRespDto_1.getInvalidTime());//SimpleFieldAssign//sourceId:24494_1
            retData.setOperationInductionId(queryStaffBeginMemberDetailRespDto_1.getOperationInductionId());//SimpleFieldAssign//sourceId:24513_1
            retData.setOperateTime(queryStaffBeginMemberDetailRespDto_1.getOperateTime());//SimpleFieldAssign//sourceId:24514_1
            retData.setUserFace(queryStaffBeginMemberDetailRespDto_1.getUserFace());//SimpleFieldAssign//sourceId:24488_1
            retData.setIdCardName(queryStaffBeginMemberDetailRespDto_1.getIdCardName());//SimpleFieldAssign//sourceId:24495_1
            retData.setNickName(queryStaffBeginMemberDetailRespDto_1.getNickName());//SimpleFieldAssign//sourceId:24496_1
            retData.setSex(queryStaffBeginMemberDetailRespDto_1.getSex());//SimpleFieldAssign//sourceId:24497_1
            retData.setBirthday(queryStaffBeginMemberDetailRespDto_1.getBirthday());//SimpleFieldAssign//sourceId:24498_1
            retData.setCity(queryStaffBeginMemberDetailRespDto_1.getCity());//SimpleFieldAssign//sourceId:24499_1
            retData.setUserIntro(queryStaffBeginMemberDetailRespDto_1.getUserIntro());//SimpleFieldAssign//sourceId:24500_1
            retData.setUserName(queryStaffBeginMemberDetailRespDto_1.getUserName());//SimpleFieldAssign//sourceId:24502_1
            retData.setEmail(queryStaffBeginMemberDetailRespDto_1.getEmail());//SimpleFieldAssign//sourceId:24503_1
            retData.setPhone(queryStaffBeginMemberDetailRespDto_1.getPhone());//SimpleFieldAssign//sourceId:24505_1
            retData.setSource(queryStaffBeginMemberDetailRespDto_1.getSource());//SimpleFieldAssign//sourceId:24507_1
            retData.setIsPtJob(queryStaffBeginMemberDetailRespDto_1.getIsPtJob());//SimpleFieldAssign//sourceId:45911_1
        }
        if (queryInductionRecordInfoDetailComRespDto_1 != null) {
            retData.setOperaterIdCardName(queryInductionRecordInfoDetailComRespDto_1.getIdCardName());//SimpleFieldAssign//sourceId:24528_1
            retData.setOperaterNickName(queryInductionRecordInfoDetailComRespDto_1.getNickName());//SimpleFieldAssign//sourceId:24529_1
        }
        if (queryOrgClassBorderDetailComBorderRespDto_1 != null) {
            retData.setInductionTypeDictionaryName(queryOrgClassBorderDetailComBorderRespDto_1.getTypeDictionaryName());//SimpleFieldAssign//sourceId:43327_1
        }
        if (queryOrgClassBorderDetailComBorderRespDto_3 != null) {
            retData.setInductionStateDictionaryName(queryOrgClassBorderDetailComBorderRespDto_3.getTypeDictionaryName());//SimpleFieldAssign//sourceId:43338_1
        }


        return retData;
    }

    /**
     * B1-2查询字母身份人员列表(平台)[4560]
     * gen by moon at 2/21/2023, 8:50:59 PM
     */
    @Trace(operationName = "B1-2查询字母身份人员列表(平台)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffQueryLetterBeginMemberListRespDto queryLetterBeginMemberList(BffQueryLetterBeginMemberListReqDto reqDto) {


        //步骤0: D1-2查询字母身份人员列表 - queryLetterBeginMemberList
        QueryLetterBeginMemberListRespDto queryLetterBeginMemberListRespDto = null;
        QueryLetterBeginMemberListReqDto queryLetterBeginMemberListReqDto = new QueryLetterBeginMemberListReqDto();
        if (reqDto != null) {
            queryLetterBeginMemberListReqDto.setIdCardName(reqDto.getIdCardName());//SimpleFieldAssign//sourceId:329200_1
            queryLetterBeginMemberListReqDto.setFirstLetter(reqDto.getFirstLetter());//SimpleFieldAssign//sourceId:329199_1
            queryLetterBeginMemberListReqDto.setIsInvalid(reqDto.getIsInvalid());//SimpleFieldAssign//sourceId:329197_1
            queryLetterBeginMemberListReqDto.setSource(reqDto.getSource());//SimpleFieldAssign//sourceId:329196_1
            queryLetterBeginMemberListReqDto.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:329198_1
        }

        /*D1-2查询字母身份人员列表[4559]   */
        Assert.isNull(queryLetterBeginMemberListReqDto.getSpaceId(), "B1-2查询字母身份人员列表(平台)-D1-2查询字母身份人员列表-创建于空间ID不能为空", false);
        queryLetterBeginMemberListRespDto = fwBaseMemberClient.queryLetterBeginMemberList(queryLetterBeginMemberListReqDto).getData();


        BffQueryLetterBeginMemberListRespDto retData = new BffQueryLetterBeginMemberListRespDto();


        return retData;
    }
    //
}
